How can I correctly replace values in a list using Python without encountering a TypeError

visit shbcf.ru